home *** CD-ROM | disk | FTP | other *** search
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
-
- namespace DiskWriter
- {
- /// <summary>
- /// Summary description for frmChooseRec.
- /// </summary>
- public class frmChooseRec : System.Windows.Forms.Form
- {
- internal System.Windows.Forms.ComboBox driveCombo;
- internal System.Windows.Forms.GroupBox GroupBox1;
- internal System.Windows.Forms.Label Label4;
- internal System.Windows.Forms.CheckBox BurnProofChk;
- internal System.Windows.Forms.Label driveBufferSizeLbl;
- internal System.Windows.Forms.Label driveMaxRSpeedLbl;
- internal System.Windows.Forms.Label driveMaxWSpeedLbl;
- internal System.Windows.Forms.Label Label3;
- internal System.Windows.Forms.Label Label2;
- internal System.Windows.Forms.Label Label1;
- internal System.Windows.Forms.Button cmdOK;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public Form1 frm;
- Int32 driveNum;
-
- public frmChooseRec()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.driveCombo = new System.Windows.Forms.ComboBox();
- this.GroupBox1 = new System.Windows.Forms.GroupBox();
- this.Label4 = new System.Windows.Forms.Label();
- this.BurnProofChk = new System.Windows.Forms.CheckBox();
- this.driveBufferSizeLbl = new System.Windows.Forms.Label();
- this.driveMaxRSpeedLbl = new System.Windows.Forms.Label();
- this.driveMaxWSpeedLbl = new System.Windows.Forms.Label();
- this.Label3 = new System.Windows.Forms.Label();
- this.Label2 = new System.Windows.Forms.Label();
- this.Label1 = new System.Windows.Forms.Label();
- this.cmdOK = new System.Windows.Forms.Button();
- this.GroupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // driveCombo
- //
- this.driveCombo.Location = new System.Drawing.Point(8, 8);
- this.driveCombo.Name = "driveCombo";
- this.driveCombo.Size = new System.Drawing.Size(284, 21);
- this.driveCombo.TabIndex = 1;
- this.driveCombo.Text = "Drive Name";
- this.driveCombo.SelectedIndexChanged += new System.EventHandler(this.driveCombo_SelectedIndexChanged);
- //
- // GroupBox1
- //
- this.GroupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.Label4,
- this.BurnProofChk,
- this.driveBufferSizeLbl,
- this.driveMaxRSpeedLbl,
- this.driveMaxWSpeedLbl,
- this.Label3,
- this.Label2,
- this.Label1});
- this.GroupBox1.Location = new System.Drawing.Point(8, 40);
- this.GroupBox1.Name = "GroupBox1";
- this.GroupBox1.Size = new System.Drawing.Size(283, 142);
- this.GroupBox1.TabIndex = 2;
- this.GroupBox1.TabStop = false;
- this.GroupBox1.Text = "Properties";
- //
- // Label4
- //
- this.Label4.Location = new System.Drawing.Point(34, 116);
- this.Label4.Name = "Label4";
- this.Label4.Size = new System.Drawing.Size(124, 18);
- this.Label4.TabIndex = 7;
- this.Label4.Text = "Burn-Proof Support";
- //
- // BurnProofChk
- //
- this.BurnProofChk.Enabled = false;
- this.BurnProofChk.Location = new System.Drawing.Point(13, 115);
- this.BurnProofChk.Name = "BurnProofChk";
- this.BurnProofChk.Size = new System.Drawing.Size(16, 18);
- this.BurnProofChk.TabIndex = 6;
- this.BurnProofChk.Text = "Burn-Proof Support";
- //
- // driveBufferSizeLbl
- //
- this.driveBufferSizeLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveBufferSizeLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.driveBufferSizeLbl.Location = new System.Drawing.Point(134, 78);
- this.driveBufferSizeLbl.Name = "driveBufferSizeLbl";
- this.driveBufferSizeLbl.Size = new System.Drawing.Size(140, 18);
- this.driveBufferSizeLbl.TabIndex = 5;
- this.driveBufferSizeLbl.Text = "0";
- this.driveBufferSizeLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // driveMaxRSpeedLbl
- //
- this.driveMaxRSpeedLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveMaxRSpeedLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.driveMaxRSpeedLbl.Location = new System.Drawing.Point(134, 54);
- this.driveMaxRSpeedLbl.Name = "driveMaxRSpeedLbl";
- this.driveMaxRSpeedLbl.Size = new System.Drawing.Size(140, 18);
- this.driveMaxRSpeedLbl.TabIndex = 4;
- this.driveMaxRSpeedLbl.Text = "0";
- this.driveMaxRSpeedLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // driveMaxWSpeedLbl
- //
- this.driveMaxWSpeedLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveMaxWSpeedLbl.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.driveMaxWSpeedLbl.Location = new System.Drawing.Point(134, 31);
- this.driveMaxWSpeedLbl.Name = "driveMaxWSpeedLbl";
- this.driveMaxWSpeedLbl.Size = new System.Drawing.Size(140, 18);
- this.driveMaxWSpeedLbl.TabIndex = 3;
- this.driveMaxWSpeedLbl.Text = "0";
- this.driveMaxWSpeedLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // Label3
- //
- this.Label3.Location = new System.Drawing.Point(14, 81);
- this.Label3.Name = "Label3";
- this.Label3.Size = new System.Drawing.Size(104, 15);
- this.Label3.TabIndex = 2;
- this.Label3.Text = "Buffer Size:";
- //
- // Label2
- //
- this.Label2.Location = new System.Drawing.Point(14, 57);
- this.Label2.Name = "Label2";
- this.Label2.Size = new System.Drawing.Size(104, 15);
- this.Label2.TabIndex = 1;
- this.Label2.Text = "Read Max Speed:";
- //
- // Label1
- //
- this.Label1.Location = new System.Drawing.Point(14, 34);
- this.Label1.Name = "Label1";
- this.Label1.Size = new System.Drawing.Size(104, 15);
- this.Label1.TabIndex = 0;
- this.Label1.Text = "Write Max Speed:";
- //
- // cmdOK
- //
- this.cmdOK.Location = new System.Drawing.Point(192, 192);
- this.cmdOK.Name = "cmdOK";
- this.cmdOK.Size = new System.Drawing.Size(95, 25);
- this.cmdOK.TabIndex = 3;
- this.cmdOK.Text = "OK";
- this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
- //
- // frmChooseRec
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(296, 221);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.cmdOK,
- this.GroupBox1,
- this.driveCombo});
- this.Name = "frmChooseRec";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "frmChooseRec";
- this.Load += new System.EventHandler(this.frmChooseRec_Load);
- this.GroupBox1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void frmChooseRec_Load(object sender, System.EventArgs e)
- {
- string DriveName = "";
- frm = (Form1)this.Owner;
-
- driveCombo.Items.Clear();
- for(short driveNum = 0; driveNum<frm.DataCDWriter1.driveCount ; driveNum++)
- {
- frm.DataCDWriter1.driveNum = (short)(driveNum + 1);
- DriveName = " " + frm.DataCDWriter1.driveVendor + " " + frm.DataCDWriter1.driveModel + " " + frm.DataCDWriter1.driveFirmwareVersion;
- driveCombo.Items.Add(DriveName);
- }
-
- if( driveCombo.Items.Count > 0 )
- {
- driveCombo.SelectedIndex = 0;
- }
- this.driveNum = frm.DataCDWriter1.driveNum;
- RefreshDriveInfo();
- }
- private void RefreshDriveInfo()
- {
- Int32 MaxSpeed = 0;
- MaxSpeed = frm.DataCDWriter1.driveMaxRSpeed;
- if( MaxSpeed > 0 )
- {
- driveMaxRSpeedLbl.Text = MaxSpeed + "-x";
- }
- else
- {
- driveMaxRSpeedLbl.Text = "N/A";
- }
-
- MaxSpeed = frm.DataCDWriter1.driveMaxWSpeed;
- if( MaxSpeed > 0 )
- {
- driveMaxWSpeedLbl.Text = MaxSpeed + "-x";
- }
- else
- {
- driveMaxWSpeedLbl.Text = "N/A";
- }
-
- if( frm.DataCDWriter1.driveBurnProofEnabled )
- {
- BurnProofChk.CheckState.Equals(true);
- }
- else
- {
- BurnProofChk.CheckState.Equals(false);
- }
-
- Int32 w = (frm.DataCDWriter1.driveBufferSize / 1024) / 1024;
- driveBufferSizeLbl.Text = w.ToString() + " MB";
- }
-
- private void cmdOK_Click(object sender, System.EventArgs e)
- {
- this.Hide();
- }
-
- private void driveCombo_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- // TODO change drive
-
- int CurDrive = 0;
- CurDrive = driveCombo.SelectedIndex;
- frm.DataCDWriter1.driveNum = (short)(CurDrive + 1);
- frm.RefreshDiskInfo();
- RefreshDriveInfo();
- frm.Refresh();
- }
- }
- }
-